<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEverydayReportTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('everyday_report', function (Blueprint $table) {
            $table->increments('id');
            $table->date('today')->comment('日期');
            $table->string('app_platform')->comment('平台');
            $table->string('app_channel')->comment('市场');
            $table->unsignedInteger('user_num')->default(0)->comment('注册用户数');
            $table->unsignedInteger('user_pay_num')->default(0)->comment('付款用户数');
            $table->unsignedInteger('order_num')->default(0)->comment('订单总数');
            $table->unsignedInteger('nopay_order_num')->default(0)->comment('未支付订单数');
            $table->unsignedInteger('pay_order_num')->default(0)->comment('已支付订单数');
            $table->unsignedInteger('first_order_num')->default(0)->comment('首充订单数');
            $table->unsignedInteger('retry_order_num')->default(0)->comment('复充订单数');
            $table->unsignedInteger('recharge_amount')->default(0)->comment('充值金额');
            $table->unsignedInteger('pay_amount')->default(0)->comment('支付金额');
            $table->unsignedInteger('mobile_recharge_amount')->default(0)->comment('话费充值金额');
            $table->unsignedInteger('mobile_pay_amount')->default(0)->comment('话费付款金额');

            $table->unsignedInteger('coupon_amount')->default(0)->comment('优惠券抵扣金额');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('everyday_report');
    }
}
